package com.service.device;

import com.common.ErrorCodeEnum;
import com.common.emums.DataStatus;
import com.common.exception.BusinessException;
import com.common.utils.StringUtils;
import com.core.springSecurity.common.SecurityUtils;

import com.dao.secondary.device.DevicePmdWorkRecordDetailInfoMapper;
import com.model.domain.device.GetDevicePmdWorkRecordDetailInfoDO;
import com.model.pojo.device.DevicePmdWorkRecordDetailInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import com.github.pagehelper.PageHelper;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;


/**
 * @Author: zql
 * @Description: 播种机作业日报统计明细信息，来源于每条GPS信息统计服务
 * @Data: 2024-01-09
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class DevicePmdWorkRecordDetailInfoService {

    private final DevicePmdWorkRecordDetailInfoMapper devicePmdWorkRecordDetailInfoMapper;

    public List<DevicePmdWorkRecordDetailInfo> getAllList(GetDevicePmdWorkRecordDetailInfoDO getDevicePmdWorkRecordDetailInfoDO){
        PageHelper.clearPage();
        PageHelper.orderBy(getDevicePmdWorkRecordDetailInfoDO.getSortRow()+getDevicePmdWorkRecordDetailInfoDO.getSortOrder());
        return devicePmdWorkRecordDetailInfoMapper.selectList(getDevicePmdWorkRecordDetailInfoDO);
    }

    public List<Map<String,Object>> getListGroupBy(Date workDate){
        return devicePmdWorkRecordDetailInfoMapper.selectListGroupBy(workDate);
    }
}
